import pandas as pd


def test1():
    data = {'state': ['Ohio', 'Ohio', 'Ohio', 'Nevada', 'Nevada', 'Nevada'],
            'year': [2000, 2001, 2002, 2001, 2002, 2003],
            'pop': [1.5, 1.7, 3.6, 2.4, 2.9, 3.2]}
    df = pd.DataFrame(data)
    print(df)

    # 如果指定了列序列，则DataFrame的列就会按照指定顺序进行排列
    df = pd.DataFrame(data, columns=['year', 'state', 'pop'])
    print(df)


def test2():
    data = {'state': ['Ohio', '']}


if __name__ == '__main__':
    test1()
